import Vue from 'vue'
import Router from 'vue-router'
import VioIndex from '../views/vioIndex.vue'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'VioIndex',
      component: VioIndex
    }
  ],
  mode: 'history'
})

// 路由控制守卫
// router.beforeEach((to, from, next) => {
//   if (to.path === '/') return next()
//   const tokenStr = window.sessionStorage.getItem('data')
//   if (!tokenStr) {
//     alert('请先登录!')
//     return next('/')
//   }
//   next()
// })

export default router
